Howdy, Stranger!

We are about to switch to a new forum software. Until then we have removed the registration on this forum.

  • KetaiGesture has a big failure rate

    some devices there is a big failure rate (some touches are not taken into account, sometimes you have to touch 2-3 times

    This is really good to document. Please state what is your Android API target, specs of your device, and a sample program reproducing the problem. Please also add your Processing version and Android mode version.

    You can also open a ticket in the ketai repo in github.

    Kf

  • How to access a field/method of the sketch from MainActivity?

    @akenaton To be more precise, I have to say that I imported my project to Android Studio.

    I am using onTap() function for getting touch events but on some devices there is a big failure rate (some touches are not taken into account, sometimes you have to touch 2-3 times somewhere). On my tablet it works fine, but not also on my smartphone.

    Because of that, I was thinking to use the standard "public boolean onTouchEvent" in MainActivity, where I would call a method of my sketch.

    I don't know the versions right now, but if necessary I will tell you soon.

  • KetaiGesture has a big failure rate

    I am using onTap() function for getting touch events but on some devices there is a big failure rate (some touches are not taken into account, sometimes you have to touch 2-3 times somewhere). On my tablet it works fine, but not also on my smartphone. Please help

  • Unexpected identifier at new Function

    @kfrajer - Sorry I should be clearer, it was working on a hosted platform before we added a domain to the platform. We then received CORS errors and had to host the PDE file elsewhere. Somehow it's become broken in the transfer. The thing I can see broken with the interaction is that when the mouse leaves the canvas, the drawing should reset.

    Sorry guys, there is HTML and JS around this which allows for the mouse position to be correct, my bad. It does get slightly complicated though as the code below may also be referencing the second PDE we have for touchscreen devices. Here it is:

    <script>
        jQuery(document).ready(function() {
            // If the browser is on a device, use the device canvas.
            if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
                jQuery('#canvas-animation').css('display', 'none');
            } else {
                jQuery('#canvas-animation-device').css('display', 'none');
            }
        });
    
        var coordX = 0;
        var coordY = 0;
    
        window.onmousemove = coordHandler;
        window.ontouchstart = coordHandler;
        window.ontouchmove = coordHandler;
    
        var width = window.innerWidth;
    
        // Desktop
        if (width > '768') {
            jQuery('#canvas-animation-device').css('min-height', '400px');
            jQuery('#canvas-animation-device').css('max-height', '400px');
            var leftPosition = 30;
        }
        // Tablet top position.
        if (width > '580' && width < '769') {
            var leftPosition = 40;
        }
        // Mobile top position.
        if (width < '581') {
            var leftPosition = 0;
        }
    
        function coordHandler(event) {
            topPosition = jQuery('#global-wrapper-cp-878fa344d768280196d58da0ded0fff9').offset().top
            switch (event.type) {
                case 'mousemove':
                    coordX = event.clientX - leftPosition;
                    coordY = event.clientY - (topPosition - window.scrollY);;
                    break;
                case 'touchstart':
                case 'touchmove':
                    var firstTouch = event.touches[0];
                    coordX = firstTouch.clientX - leftPosition;
                    coordY = firstTouch.clientY - (topPosition - window.scrollY);
                    break;
            }
        }
    
        window.blockMenuHeaderScroll = false;
        jQuery(window).on('touchstart', function(e)
        {
            if (jQuery(e.target).closest('#canvas-animation-device').length == 1)
            {
                blockMenuHeaderScroll = true;
            }
        });
        jQuery(window).on('touchend', function()
        {
            blockMenuHeaderScroll = false;
        });
        jQuery(window).on('touchmove', function(e)
        {
            if (blockMenuHeaderScroll)
            {
                e.preventDefault();
            }
        });
    </script>
    
  • [Android] How to create notifications, even when the app is closed.(2)

    [REFERENCE LINK] https://forum.processing.org/two/discussion/4429/notifications-in-android-mode https://forum.processing.org/two/discussion/16840/how-to-create-notifications-even-when-the-app-is-closed

    How to create notifications, even when the app is closed.

    Is it impossible with the Processing(android mode) program?

    https://developer.android.com/guide/topics/ui/notifiers/notifications.html#CreateNotification

    [EXAM]

    import android.view.MotionEvent; 
    import android.content.Context;
    import android.app.Notification;
    import android.app.NotificationManager;
    import android.app.Activity;
    
    Activity act;
    NotificationManager gNotificationManager;
    Notification gNotification;
    long[] gVibrate = {0,250,50,125,50,62};
    Context ctx;
    
    void setup() {
      size(displayWidth, displayHeight);
    
    
    }
    
    void draw() {
    
    }
    
    
    void onResume() {
      super.onResume();
      // Create our Notification Manager:
      gNotificationManager = (NotificationManager) this.getActivity().getSystemService(Context.NOTIFICATION_SERVICE);
      // Create our Notification that will do the vibration:
      gNotification = new Notification();
      // Set the vibration:
      gNotification.vibrate = gVibrate;
    }
    
    public boolean surfaceTouchEvent(MotionEvent event) {
      // If user touches the screen, trigger vibration notification:
      gNotificationManager.notify(1, gNotification);
      return super.surfaceTouchEvent(event);
    }
    

    It does not work.

  • Joystick while Being able to shoot.

    You will have to track multiple touches using the touches array. Not done it myself yet ... there is a basic example on the Android mode website

    http://android.processing.org/reference/multitouch/touches.html

  • Collisions/ End Game

    I got somewhat far with my code, in my eyes, and I have one slight problem. I wanted to make my game end when my white character guy touches any of the fast moving red rectangles. The rectangles were supposed to move side to side, but what I have now will do. I also wanted to collect coins or some sort of rewards, (like pac-man) and then the game will finish. However, since I haven't been able to figure out the whole overlap/distance thing I'm not even sure if that is possible. Does any one have an example to explain this to me, or what I have to add to make this work? I've been trying for a whole week and nothing has worked yet. Thank you.

    PFont title;
    int menu;
    int sub_cnt;
    int sub_cntt;
    int sub_cnttt;
    int earthsize = 30;
    int earth = 200;
    int x=0;
    int y=0;
    float a,b, s=8;
    boolean fireNow = false;
    float xPos = 600;
    float xxPos = 600;
    float xxxPos = 600;
    float xxxxPos = 600;
    int rad = 40;
    int xdirection = 1;
    int ydirection = 1;
    float xspeed = 2.8; 
    float yspeed= 2.2;
    float yPos;
    
    
    
    
    
    
    
    //float rectX;
    //float rectY;
    
    
    
    
    void setup () {
      size(700, 700);
      title = createFont ("font", 28, true);
      menu = 1;
      background(0, 0, 30);
    
    
    }
    
    void draw () {
    
      if (menu == 1) {
        ellipse (random (width), random (height), random (4), random (4));
        textAlign(CENTER);
        textSize(112);
        text ("SEPTUA", 350, 300);
        textSize(30);
        text("press any key to start", 350, 325);
      }
      if (menu == 2) {
        background (0, 0, 30);
        //earth color
        fill(25, 54, 76);
        ellipse(earth, earth + 98,earthsize, earthsize);
        //rectangle (text box)
        fill(0, 0, 60);
        rect (0, 500, 700, 700);
        //text inside the box
        textSize(17);
        fill(255, 255, 255);
        String msg = "IN THE YEAR 3064, EARTH HAS BEEN CONSUMED BY A PLAGUE.";
        text (msg.substring(0,constrain(int(sub_cnt/5),0,msg.length())), 300, 560);
        sub_cnt++;
        if( sub_cnt == 12*msg.length() ){
          menu = 3;
        }
      }
      if ( menu == 3 ) {
        background(0,0,30);
        //earth animation (how it expands)
        fill(25, 54, 76);
        earthsize = earthsize + 1;
        ellipse(earth, earth+98, earthsize, earthsize);
        //text box
        fill(0,0,60);
        rect (0,500,700,700);
        textSize (17);
        fill(255, 255, 255);
        String msg = "THE HUMAN POPULATION HAS DECREASED BY 64%" ;
        text (msg.substring(0, constrain(int(sub_cntt/5), 0,msg.length())), 250, 560);
        sub_cntt++;
        if (sub_cntt == 12*msg.length () ){
          menu= 4;
        }
      }
    
      if (menu ==4) {
    
          background(0);
          text("You're going on a mission to retrieve the cure", width/2, height/2);
          text("Press Z to continue", width/2, height/2-20);
          if(keyPressed==true){
            if (key=='z' || key == 'Z'){
              menu = 6;
            }
          }
          if (keyPressed == true){
          menu= 5;
          }
        }
    
    
    
    
        if (menu ==5){
         ellipse (random (width), random (height), random (4), random (4));
          background (0, 0, 30);
           fill(220,220,220);
          rect(0, 400, 700, 300);
          //this next code is our sprite....
          fill(255, 255, 255);
          rect(x, y, 40, 40);
    
          //this next code will be our enemy
    
          //enemy # 1
          fill(160, 0, 0);
         // xPos = xPos - 1;
          rect(xPos - 20, 200, 40, 40);
          //enemy # 2
          fill(160, 0, 0);
          rect(xxPos - 20, 300, 40, 40);
    
          fill(160, 0, 0);
          rect(xxxPos-20, 400, 40, 40);
    
          fill(160, 0, 0);
          rect(xxxxPos-20, 500, 40, 40);
    
    
    
    
         // xPos = xPos + (xspeed * xdirection);
         // yPos = yPos + (yspeed * ydirection);
         // if(xPos> width-rad|| xPos < rad){
         //  xdirection = -1;
        //  }
    
        //  if (yPos > height-rad || yPos < rad) {
       // ydirection *= -1;
      //}
    
      if (xPos<700){
        xPos= xPos +10;
      }
      else if (xPos-30>600){
        xPos=xPos *-5;
      }
    
       if (xxPos<700){
       xxPos=xxPos +10;
      }
      else if (xPos-40>200){
        xxPos=xxPos *-5;
    
      }
    
           if (xxxPos<700){
      xxxPos=xxxPos+10;
      }
      else if (xxxPos-30>200);
       xxxPos=xxxPos*-5;
    
      }
    
      if (xxxxPos<700){
        xxxxPos=xxxxPos+10;
      }
      else if(xxxxPos-30>200){
        xxxxPos=xxxxPos*-5;
      }
    
    
    
    
    
    
    
    
    
    
    
    
          if (fireNow==true){
            if(a < height && b < width){
              fill(0,191,255);
              rect(a, b, 45, 10);
              a = a+x;
              b = b+(s);
            } else {
              fireNow = false;
    
            }
    
    
          }
        }
    
    
    
    
    void keyPressed() {
      if (menu == 1) {
        menu = 2;
        sub_cnt = 0;
      }
      if (menu == 3) {
        menu = 4;
        sub_cnt = 0;
     }
     if(menu == 4) {
       menu = 5;
       sub_cnt = 0;
     }
    
    
    
    
       if (key == CODED) {
         if (keyCode == UP) {
           y-= 4;
         } else if (keyCode == DOWN) {
           y += 4;
         }
         else if (keyCode ==LEFT) {
           x-= 4;
         }
         else if (keyCode ==RIGHT) {
           x+= 4;
         }
         else if (keyCode == SHIFT) {
           y -= 60;
    }
    }
    
    
        }
    
    
    
    void keyReleased() {
        if (key ==TAB){
          fireNow=true;
          a=x;
          b=y;
        }
      }
    
  • Processing 3.3.6 - Printing letters when they are hit by a circle

    Hello, very new programmer needing help with printing a letter(s) at the bottom of the window.

    The premise of the program is this

    1) User controls a "gun" that moves left to right with arrow keys, and shoots a stream of bullets with mouse press. At the top of the window, there is an alphabet looping from left to right.

    2) What I need help with: When the stream of circles touches a letter at the top, the letter that was "hit" will appear at the bottom of the window. Each successive letter hit will appear next to one before.

    How should I do this? The way I have it right now, I am making the letters with a for loop, and it is made with a string, so I'm not sure how I would use something like charAt without turning it into a string.

    Here is my code. Any help is greatly appreciated, thank you!

    float windowHeight;
    
    float windowY;
    
    // shooter
    
    float shooterSize;
    
    float shooterX;
    
    float shooterY;
    
    // shooter tip
    float shooterTriX1 = shooterX;
    float shooterTriY1 = shooterY;
    float shooterTriX2 = shooterX + shooterSize / 2;
    float shooterTriY2 = shooterY - shooterSize;
    float shooterTriX3 = shooterX + shooterSize;
    float shooterTriY3 = shooterY;
    // shooter speed
    final float shooter_SPEED = 2.0;
    //colors
    final int BLACK = 0;
    final int WHITE = 255;
    
    
    // bullets
    int bullets = 1;
    float BY;
    float BX;
    int bulletSize = width/12;
    final float BULLET_SPACING = 50;
    final float BULLET_SPEED = 4.0;
    boolean shoot = false;
    float nextBullet;
    
    // chars
    char char1 = 'Z';
    char nextchar;
    float charX;
    float charMoveSpeed = 2;
    float charSpacing;
    float ALPHABET = 26;
    
    void printHitLetters() {
    line(0,windowY, width, windowY);
    
    void drawchars() {
    float charX2 = charX;
    
    for(int i = 0; i < ALPHABET; i++) {
    nextchar = char(char1 - i);
    textSize(charSpacing);
    fill(BLACK);
    // reset alphabet
    text(nextchar, (charX2 - (charSpacing * i)) % (ALPHABET * charSpacing) - charSpacing, charSpacing);
    }
    
    void movechars() {
    charX += charMoveSpeed;
    
    }
    
    
    void moveshooter() {
    if (keyPressed) {
    if ( keyCode == LEFT ) {
    shooterX -= shooter_SPEED;
    if ( shooterX < 0 ) {
    // reset
    shooterX = max(shooterX, 0);
    }
    } // LEFT MOVEMENT
    
    else if ( keyCode == RIGHT ) {
    shooterX += shooter_SPEED;
    if (shooterX > (width - shooterSize)) {
    // reset
    shooterX = min(width - shooterSize, shooterX);
    }
    } // RIGHT MOVEMENT
    
    } // KEY PRESSED
    
    } // move shooter
    
    void drawshooter() {
    shooterTriX1 = shooterX;
    shooterTriY1 = shooterY;
    shooterTriX2 = shooterX + shooterSize / 2;
    shooterTriY2 = shooterY - shooterSize;
    shooterTriX3 = shooterX + shooterSize;
    shooterTriY3 = shooterY;
    fill(255);
    stroke(BLACK);
    rect(shooterX, shooterY, shooterSize, shooterSize);
    triangle(shooterTriX1, shooterTriY1, shooterTriX2, shooterTriY2, shooterTriX3, shooterTriY3);
    } // draw shooter
    
    void mousePressed() {
    if (!shoot) {
    BX = shooterTriX2;
    BY = shooterTriY2;
    } // set bullet position
    shoot = true;
    } // mouse pressed
    
    void drawShot(){
    
    if (shoot) {
    int i = 0;
    while (i < 10) {
    nextBullet = min((BY + (i * BULLET_SPACING)), shooterTriY2);
    fill(BLACK);
    stroke(BLACK);
    ellipse(BX, BY, bulletSize, bulletSize);
    ellipse(BX, nextBullet, bulletSize, bulletSize);
    i++;
    } // while loop to draw bullets
    
    if (BY < 0) {
    shoot = false;
    } // stop bullets when top of window is hit
    
    } // if there is shooting
    
    } // draw shot function
    
    void moveShot(){
    
    if (shoot && BY >= 0) {
    BY -= BULLET_SPEED;
    } // move bullets
    } // move bullets function
    
    void setup() {
    size(700,700);
    windowHeight = height/12;
    windowY = height - windowHeight;
    shooterSize = width / 15;
    shooterX = (width / 2) - (shooterSize / 2);
    shooterY = height - (height / 15) - windowHeight;
    bulletSize = width/50;
    charSpacing = width/25;
    charX = -charSpacing;
    } // setup
    
    
    void draw() {
    background(255);
    printHitLetters();
    movechars();
    drawchars();
    moveshooter();
    drawshooter();
    drawShot();
    moveShot();
    
    } // draw
    

    [original post vandalised, restored from backup. might not be exact.]

  • Handling multi touch in p5.js

    To specify which was the "last touch," then, it sounds like you need to use the touches array, check how many are in there, and then act based on the most recently pressed touch.

    While designing that, you may want to check whether the most recently pressed touch is the first or the last touch in the list -- or if there is no pattern, and you need to keep track of it yourself.

  • Handling multi touch in p5.js

    The last touch should react meaning if the use has touched the right then the ball moves to the right and when the user touches left without releasing the right then the left should react.

  • How to use non-static variables from a class??

    I want some leeway so the if the fish touches anywhere in the Bass, you lose. And yes, I want to check both objects. Could you give me some edited code??? Thanks!

  • Exported Application freezing on MacOS

    I am making a game with Processing 3, and it runs perfectly in the PDE; although, when I export the application and run it, the game freezes when a certain method is called: gameOver(). The gameOver() method is called whenever the player is hurt by an enemy (which is whenever an enemy touches the player).

    The only thing that I can think of is that it loads an image, but I have used the add file button to add the image and everything.

    I'm running macOS Sierra 10.12.6.

    Here is the link to the code and applications. http://www.mediafire.com/folder/seq00jfeqsl69/Open_Desktop_Adventure

  • Bouncing ball losing height without drag force?

    Hello world!

    I'm currently going through the 9 chapters of Nature of Code and I have an issue with one exercise. In the "2.4 Intro to friction forces" video, I did everything properly, understood the script and changed it to a single dropping ball with constant gravity being the only factor changing the ball PVector acceleration. Strangely, in both my and Daniel Shiffman sketch, the bouncing ball lose max height at each 2 rebound. He does not adress this issue.

    This is very weird and should not happen?!? since there is nothing that should make the ball lose velocity on each 2 rebounds. My guess is that there is something I don't know about the edgeBounce() I made and how it interact with the window borders, maybe chipping away a pixel of height in the process of reverting the ball velocity when it touches the ground.

    The code below work properly, but I think the fault reside somewhere in it or in how it interact with the ball.

    void edgeBounce() {
      if (location.x > width) {
        location.x = width;
        velocity.x *= -1;
      }
      if (location.x < 0) {
        location.x = 0;
        velocity.x *= -1;
      }
      if (location.y > height) {
        location.y = height;
        velocity.y *= -1;
      }
      if (location.y < 0) {
        location.y = 0;
        velocity.y *= -1;
      }
    

    Can anyone help me on this? Why is the ball losing velocity at each secound bounce? Google drive link to my sketch, you can visualise the problem yourself!

    https://drive.google.com/open?id=1yrXe4HzpJoNk_WAZoUy24jcRY_TjHli4

    Any help very appreciated!

  • disappearing targets after shooting/automatic shooting from objects

    Can someone help me with this one. As you can see in the code I want the enemySpaceShips to have automatic shooting while they are moving and a "HP" that when it is equal to zero, the enemySpaceShip "dies" and they "respawn" to the top of the screen. I also want that when the enemySpaceShips crashes/touches the shooter(red spaceship), they both "die" or when it hit the shooter, the shooter dies. Thanks in advance.

    Automatic shooting of enemySpaceShips is the only one answered.

  • How do I stop moving particles by clicking on them?

    I was able to make them stop when the mouse touches them, but now I want the particles to stop when I click on them, any idea how? Thanks in advance.

    ArrayList<Circulo> c;
    int n;
    
    void setup(){
      size(700,500);
      n=10;
      c= new ArrayList<Circulo> ();
      for (int i=0; i<n; i++){
       c.add(new Circulo(30, random(width), random(height), random(2,10), random(2,10))); 
      }
    }
    
    
    void draw(){
      background(255);
      background(10);
      fill(255);
      for (Circulo ci : c){
      ci.move();
      ci.display();
      ci.mousePressed();
      }
    }
    
    class Circulo{
      boolean sobre_circulo = false;
      boolean bloqueo = false;
      float x, velocidadX, velocidadY, y, d;
      float movX = 0.0;
      float movY = 0.0;
      Circulo(float diametro, float posX, float posY, float vx, float vy){
    
        d = diametro;
        x = posX;
        y = posY;
        velocidadX = vx;
        velocidadY = vy;
      }
    
      void display(){ 
      ellipse(x, y, d, d);  
      }
    
      void move(){ 
    
    
          y = y + velocidadY;
          x = x + velocidadX;
      if (x > width){
        velocidadX = -velocidadX;
      }
      if (x < 0){
        velocidadX = -velocidadX;
      } 
    
      if (y > height){
        velocidadY= -velocidadY;
      }
      if (y < 0){
        velocidadY= -velocidadY;
      }  
    
    
    
      }
    
      void mousePressed(){
    
       if(mouseX > x-d && mouseX < x+d && mouseY > y-d && mouseY < y+d) { 
        velocidadX = 0;
        velocidadY = 0;
        bloqueo = true; 
        fill(255, 255, 255);
      } else {
        bloqueo = false;
      }
      }
    
    }
    
  • Get location of touch events on touchscreen device, similar to mouse location

    I ignored this issue for 2 years! But approached it again this weekend, and just wanted to post my experience.

    As Processing.js doesn't seem to have full support for touch coordinates, I decided to abstract mouse/touch coordinates out of Processing and just use plain JavaScript to determine these coordinates, and store them as JavaScript variables. Processing has access to JavaScript variables - so instead of using e.g. mouseX in Processing, I just reference the JavaScript variable instead.

    I wrote a small on-event handler to handle mousemove, touchstart and touchmove events. I detect the type of the Event, and in the case of touch events, I access the first Touch by accessing touches[0]. Then the clientX and clientY properties give me the coordinates of the mouse or touch event. Just store these values to JavaScript variables, and they can then be accessed from the draw() function in Processing.

    Success.

    In HTML/JavaScript:

    <script>
    var coordX = 0;
    var coordY = 0;
    
    window.onmousemove = coordHandler;
    window.ontouchstart = coordHandler;
    window.ontouchmove = coordHandler;
    
    function coordHandler(event) {
        switch (event.type) {
            case 'mousemove':
                coordX = event.clientX;
                coordY = event.clientY;
                break;
            case 'touchstart':
            case 'touchmove':
                var firstTouch = event.touches[0];
                coordX = firstTouch.clientX;
                coordY = firstTouch.clientY;
                break;
        }
    }
    </script>
    

    In Processing:

    void draw() {
        background(255, 255, 255);
        stroke(255, 0, 0);
        line(0, 0, coordX, coordY);
    }
    

    PS. My canvas is the full width/height of the browser viewport. I'm not sure if some adjustment to the above code would be required to get correct coordinates if the canvas is not anchored at (0,0) of the browser viewport for example.

  • Sharing my work (G. Analytics Visualization) and some doubts

    I've just published this P5js sketch that allows users with Analytics accounts to visualize their data geographically. http://tailorandwayne.com/starry-analytics/ (some example shots at the end of the post)

    Still many things to improve. My management of html elements, for example... but also, I've encountered these problems that might either be bugs or my fault (I'm just getting started on P5js):

    • When using a function as the callback for a DOM element event,

            var but = createButton(items[i].name,items[i].type+","+items[i].created);
            but.id(items[i].id);
            but.parent(profilesP);
            but.addClass("setupB");
            but.mousePressed(selectProfile);
      

    I was expecting to be able to access the element's value using this.value(), but instead I have to dig into the object's properties and find this.elt.value. Is that expected?

    • The touches array was always empty, even when using a phone browser and multiple fingers.
    • I set the canvas as the background via index-z, then it becomes unclickable. I work my way around that by making all other elements unselectable,

      .unselectable {
          -webkit-touch-callout: none;
          -webkit-user-select: none;
          -khtml-user-select: none;
          -moz-user-select: none;
          -ms-user-select: none;
          user-select: none;
      }
      

    and especially flagging when the mouse is clicking on a DOM object and then assuming that the rest of clicks and drags within the canvas must be on it. Still, often the mouse interaction is not reliable. Not sure if there's a cleaner way of achieving this.

    Here's the code if anyone's interested: https://github.com/JuanIrache/StarryAnalytics

    And some shots of my data:

  • Error on app start

    I have a game I made and I decided to try to make it for android. I copied the code to another file to start the android version. I changed "mouseX" and "mouseY" to touches[0] for now and I made the keyboard detection section of the code a comment to make sure it didn't stuff up the compiling because it hasn't been opening. The error is below:

    FATAL EXCEPTION: Animation Thread Process: processing.test.trimatelegacyc, PID: 19161 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/processing.test.trimatelegacyc-1/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.trimatelegacyc-1/lib/arm, /system/lib, /vendor/lib]]] couldn't find "libMethClaInterface.so" at java.lang.Runtime.loadLibrary0(Runtime.java:984) at java.lang.System.loadLibrary(System.java:1562) at processing.sound.MethClaInterface.<clinit>(Unknown Source) at processing.sound.Engine.<init>(Unknown Source) at processing.sound.Engine.<init>(Unknown Source) at processing.sound.Engine$LazyHolder.<clinit>(Unknown Source) at processing.sound.Engine$LazyHolder.access$100(Unknown Source) at processing.sound.Engine.start(Unknown Source) at processing.sound.SoundFile.<init>(Unknown Source) at processing.test.trimatelegacyc.TrimateLegacyC.setup(TrimateLegacyC.java:123) at processing.core.PApplet.handleDraw(Unknown Source) at processing.core.PSurfaceNone.callDraw(Unknown Source) at processing.core.PSurfaceNone$AnimationThread.run(Unknown Source) FATAL EXCEPTION: Animation Thread Process: processing.test.trimatelegacyc, PID: 19274 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/processing.test.trimatelegacyc-1/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.trimatelegacyc-1/lib/arm, /system/lib, /vendor/lib]]] couldn't find "libMethClaInterface.so" at java.lang.Runtime.loadLibrary0(Runtime.java:984) at java.lang.System.loadLibrary(System.java:1562) at processing.sound.MethClaInterface.<clinit>(Unknown Source) at processing.sound.Engine.<init>(Unknown Source) at processing.sound.Engine.<init>(Unknown Source) at processing.sound.Engine$LazyHolder.<clinit>(Unknown Source) at processing.sound.Engine$LazyHolder.access$100(Unknown Source) at processing.sound.Engine.start(Unknown Source) at processing.sound.SoundFile.<init>(Unknown Source) at processing.test.trimatelegacyc.TrimateLegacyC.setup(TrimateLegacyC.java:123) at processing.core.PApplet.handleDraw(Unknown Source) at processing.core.PSurfaceNone.callDraw(Unknown Source) at processing.core.PSurfaceNone$AnimationThread.run(Unknown Source)

    The app goes on the phone and then when i open it, it closes back up straight away and doesn't say anything.. Just straight up closes.

    Anyone who might know what is going on or needs any more information to help is greatly appreciated :)

  • Ellipse Collisions

    I would guess that at a certain point producing the required solution system will be more computationally intensive than a raster-based collision solution -- and the code of a raster-based solution will also be easier to write and more legible.

    Just draw two low-rez ellipses into buffer. If your second ellipse touches a pixel that was already touched, return a hit.

    This approach has the disadvantage of not being elegant, but a major advantage is that it is flexible. If you change your two ellipses into two rounded rectangles or obrounds (or make one side flat, or give them legs, etc.) -- then raster collision still just works. Of course, it is extremely inefficient of you are working with shapes that have simple solutions.